package com.tony.blog.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 *
 * @Title: BlogEntity
 * @Auther: 皮蛋布丁
 * @Date: 2021/08/15/18:56
 * @Description: 博文
 */
@Data
@TableName("blog")
@Accessors(chain = true)
public class BlogEntity implements Serializable {

    @TableId
    private Integer id;
    //内容
    private String content;
    //作者
    private Long userId;
    //类型：1-自己 2-转发
    private Integer type;
    //转发微博的id
    private Integer blogId;
    //创建时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;
    //是否有效(1是 0否)
    private Integer isActive;
    //是否删除(1是 0否)
    private Integer isDelete;
    //删除时间
    private Date deleteTime;
    //更新时间
    private Date updateTime;
    //备注字段
    private String memoA;

    @TableField(exist=false)
    private String userName;

    @TableField(exist=false)
    private String nickName;

    @TableField(exist=false)
    private String headerImg;

    @TableField(exist=false)
    private List<String> imgUrls;

    //转发的微博的存储
    @TableField(exist=false)
    private Map<String,Object> otherMap;


    //后端管理微博列表时需要使用到
    @TableField(exist=false)
    private Integer commentTotal=0;

    @TableField(exist=false)
    private Integer praiseTotal=0;

    @TableField(exist=false)
    private Integer collectTotal=0;


    //临时高亮显示的内容
    @TableField(exist=false)
    private String highContent;
}
